#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	long n,l,r,max=0;
	cin>>n>>l>>r;
	if(n>l||n<2||l>r)
	  cout<<"0"<<endl;
	for(int i=l;i<=r;i++)
	{
		int a=i/n;
		a=i-(a*n);
		if(a>=max)
		  max=a;
	}
	cout<<max<<endl;
	fclose(stdin);
	fclose(stdout);
	return 0;
}
